home *** CD-ROM | disk | FTP | other *** search
- on RemoveExtension s
- set pos to offset(".", s)
- if pos > 0 then
- set s to chars(s, 1, pos - 1)
- end if
- return s
- end
-
- on stripWhiteSpace s, where
- if (where = #start) or (where = #both) then
- set pos to 1
- repeat while pos <= length(s)
- set c to char pos of s
- if (c = " ") or (charToNum(c) < 32) then
- set pos to pos + 1
- next repeat
- next repeat
- end if
- exit repeat
- end repeat
- set s to chars(s, pos, length(s))
- end if
- if (where = #end) or (where = #both) then
- set pos to length(s)
- repeat while pos > 0
- set c to char pos of s
- if (c = " ") or (charToNum(c) < 32) then
- set pos to pos - 1
- next repeat
- next repeat
- end if
- exit repeat
- end repeat
- set s to chars(s, 1, pos)
- end if
- return s
- end
-
- on MyWindow
- set miaw to 0
- set movieName to RemoveExtension(the movie)
- if windowPresent(the movie) then
- set w to window the movie
- else
- if windowPresent(movieName) then
- set w to window movieName
- else
- if windowPresent(the moviePath & movieName) then
- set w to window (the moviePath & movieName)
- else
- set w to VOID
- end if
- end if
- end if
- return w
- end
-
- on CastLibNumOfMember aMemberNum
- if aMemberNum > 0 then
- set s to string(member aMemberNum)
- set pos to offset("castLib ", s)
- set pos2 to offset(")", s)
- return integer(chars(s, pos + 8, pos2 - 1))
- else
- return 0
- end if
- end
-
- on ClearPuppets
- set puppetStates to []
- repeat with channelNum = 1 to 48
- puppetSprite(channelNum, 0)
- end repeat
- end
-
- on SaveAndClearPuppets
- set puppetStates to []
- repeat with channelNum = 1 to 48
- append(puppetStates, the puppet of sprite channelNum)
- puppetSprite(channelNum, 0)
- end repeat
- SG(#gPuppetSaveState, puppetStates)
- end
-
- on RestorePuppets aMember
- set puppetStates to GG(#gPuppetSaveState)
- repeat with channelNum = 1 to 48
- puppetSprite(channelNum, getAt(puppetStates, channelNum))
- end repeat
- CG(#gPuppetSaveState)
- end
-
- on isFrameEmpty
- if the frameScript <> 0 then
- return 0
- end if
- if the frameSound1 <> 0 then
- return 0
- end if
- if the frameSound2 <> 0 then
- return 0
- end if
- if the frameTransition <> 0 then
- return 0
- end if
- repeat with num = 1 to 48
- if the memberNum of sprite num <> 0 then
- return 0
- end if
- end repeat
- return 1
- end
-
- on SetField fieldName, stringValue, fontName, fontSize, fontStyle
- set wasEmpty to 0
- if stringValue = EMPTY then
- set stringValue to " "
- set wasEmpty to 1
- end if
- set the text of field fieldName to stringValue
- if the paramCount > 2 then
- set the textFont of field fieldName to fontName
- set the textSize of field fieldName to fontSize
- set the textStyle of field fieldName to fontStyle
- end if
- if wasEmpty then
- set the text of field fieldName to EMPTY
- end if
- end
-